<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title th:replace="~{commons/admincommon::title}">index</title>
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}">
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div th:replace="~{commons/admincommon::header}"></div>
    <div th:replace="~{commons/admincommon::sidebar(active='addArticle.html')}"></div>

    <div class="layui-body">
        <fieldset class="layui-elem-field layui-field-title">
            <legend>添加博文</legend>
        </fieldset>
        <form class="layui-form" enctype="multipart/form-data" th:action="@{/article/add}" method="post">
            <input type="hidden" name="id">
            <div class="layui-form-item">
                <label class="layui-form-label">文章标题</label>
                <div class="layui-input-block">
                    <input type="text" name="title" required placeholder="请输入文章标题"
                           class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">文章简介</label>
                <div class="layui-input-block">
                    <textarea name="summary" required placeholder="请输入文章简介"
                              class="layui-textarea"></textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">是否置顶</label>
                <div class="layui-input-block">
                    <input type="radio" name="isTop" value="1" title="是"/>
                    <input type="radio" name="isTop" value="0" title="否" checked=""/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">上传文章</label>
                <div class="layui-input-block">
                    <input type="file" name="file" required>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" type="submit">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>
    </div>
    <div th:replace="~{commons/admincommon::footer}"></div>
</div>
<script th:src="@{/layui/layui.js}"></script>
<script>
    layui.use(['element'], function () {
        var element = layui.element;
    });
    layui.use('form', function () {
        var form = layui.form;
    })
</script>
</table>
</body>
</html>